<?php

class MyController
{
    public function invoke()
    {
        $task = null;
        
        if(isset($_GET['task']) || isset($_POST['task']))
        {
            $task = isset($_GET['task']) ? $_GET['task'] : $_POST['task'];
        }
        
        switch($task)
        {
            case "getAll":
                $this->getAll();
                break;
            case "add":
                $this->add();
                break;
            case "edit":
                $this->edit();
                break;
            case "delete":
                $this->delete();
                break;
            case "login":
                $this->login();
                break;
            case "logout":
                $this->logout();
                break;
            case "treeview":
                $this->treeview();
                break;
            default:
                $this->getAll();
                break;
        }
    } 
}

?>